﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WebsiteBanThucAn.Models;

namespace WebsiteBanThucAn.Controllers
{
    public class AccountController : Controller
    {
        private HappyFastFoodContext db = new HappyFastFoodContext();
        //
        // GET: /Account/Login
        public ActionResult Login()
        {

            return View();
        }
        //
        // GET: /Account/Logoff
        public ActionResult Logoff()
        {
            return View();
        }
        //
        // GET: /Account/Register
        public ActionResult Register()
        {
            return View();
        }
        //
        // GET: /Account/Register
        public ActionResult RegisterSuccess()
        {
            return View();
        }
        //
        // GET: /Account/ChangeInformation
        public ActionResult ChangeInformation()
        {
            return View();
        }
        //
        // POST: /Account/Login
        [HttpPost]
        public ActionResult Login(KhachHangModel khm)
        {
            return View();
        }
        //
        // POST: /Account/Logoff
        [HttpPost]
        public ActionResult Logoff(KhachHangModel khm)
        {
            return View();
        }
        //
        // POST: /Account/Register
        [HttpPost]
        public ActionResult Register(KhachHangModel khm)
        {
            if (ModelState.IsValid)
            {
                db.KhachHangs.Add(khm);
                db.SaveChanges();
                return RedirectToAction("RegisterSuccess", "Account");
            }
            return View(khm);
        }
        //
        // POST: /Account/ChangeInformation
        public ActionResult ChangeInformation(KhachHangModel khm)
        {
            return View(khm);
        }
    }
}
